/**
 * Created by Administrator on 2015/10/6 0006.
 */
/**
 * Created by Administrator on 2015/9/29 0029.
 */
$(document).ready(function () {
    var s= {
        ready:function(){
            s.goto(s.n);
            s.out(s.n);
            s.list=$(".switch-on");
        },
        list:[],
        n:1,
        goto: function(i){
            var on=$("#switch-left-"+i);
            var off=$("#switch-right-"+i);
            var btn=$("#switch-on-"+i);
            on.click(function(){
                btn.removeClass("switch-on");
                btn.addClass("switch-off");
                });
        },
        out: function(i){
            var on=$("#switch-left-"+i);
            var off=$("#switch-right-"+i);
            var btn=$("#switch-on-"+i);
                off.click(function(){
                    btn.removeClass("switch-off");
                    btn.addClass("switch-on");
                });
        }
    };
    s.ready();
    return window.s=s
});